package com.zx.mes.rabbit.transaction.hyl.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.stereotype.Component;

/**
 * 监听实现
 * @author hyl
 * @date 2018-3-20
 */
@Component
public class BizMessageListener extends AbstractMessageListener  {

    private static final Logger logger = LoggerFactory.getLogger(BizMessageListener.class);

    @Override
    public void receiveMessage(Message message, MessageConverter messageConverter) {
        Object bizObj = messageConverter.fromMessage(message);
        logger.info("get message success:"+bizObj.toString());
    }
}